//
//  main.m
//  Text
//
//  Created by wjn on 15/10/14.
//  Copyright (c) 2015年 WJN. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Man.h"
#import "Woman.h"
#import "Child.h"
#import "Family.h"
#import "Fraction.h"
int main(int argc, const char * argv[]) {
   Woman *wife = [[Woman alloc] initWithName:@"" withSex:@"" withAge:23];
    Child *son = [[Child alloc] initWithName:@"王晨曦" withSex:@"女" withAge:2];
    Man *husband = [[Man alloc] initWithName:@"" withSex:@"" withAge:23];
    
//   给man赋值
    [husband setSon:son];
    [husband setWife:wife];
    
//    给woman赋值
    [wife setSon:son];
    [wife setHusband:husband];
    
//    给son赋值
    [son setFather:husband];
    [son setMother:wife];
    
    
    
    Family *family = [Family familyWithHusband:husband withWife:wife withSon:son];
    
    [family party];
    
   
    Fraction *fraction = [[Fraction alloc]initWithNumerator:4 withDenominator:6];
    Fraction *fraction2 = [[Fraction alloc]initWithNumerator:4 withDenominator:6];
    [fraction print];
    
    [fraction reduce];
    [fraction print];
    
    Fraction *result = [[Fraction alloc]init];
    result = [fraction addFraction:fraction2];
    [result print];
    
    Fraction *result1 = [fraction MulFraction:fraction2];
    [result1 print];
    
    Fraction *result2 = [fraction SubFraction:fraction2];
    [result2 print];
    
    Fraction *result3 = [fraction DivisionFraction:fraction2];
    [result3 print];
    return 0;
}
